//
//  LessonTableViewCell.m
//  ThePrivateKitchen
//
//  Created by lirui on 16/1/20.
//  Copyright © 2016年 www.lanou3g.com蓝鸥科技. All rights reserved.
//

#import "LessonTableViewCell.h"

@implementation LessonTableViewCell

- (void)dealloc
{
    
    [_img release];
    [_title release];
    [_sum release];
    [super dealloc];
}
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.img = [[ UIImageView alloc] init];
       // _img.backgroundColor = [ UIColor redColor];
        [self.contentView addSubview:_img];
        [_img release];
        self.title =[[ UILabel alloc] init];
        //_title .backgroundColor =[ UIColor greenColor];
        [self.contentView addSubview:_title];
        _title.textAlignment = NSTextAlignmentCenter;
        [_title release];
        
        self.sum = [[ UILabel alloc] init];
        //_sum.backgroundColor =[ UIColor greenColor];
        [self.contentView addSubview:_sum];
        [_sum release];
        
        
    }
    return self;
}
-(void)layoutSubviews
{
    [super layoutSubviews];
    _img.frame = CGRectMake(WIDTH * 10,HEIGHT * 10, self.contentView.frame.size.width - 20,HEIGHT * 150);
    _title.frame = CGRectMake(10 *WIDTH, HEIGHT*10, WIDTH*200, HEIGHT*30) ;
    _title.center = _img.center;
    
    _sum.frame = CGRectMake( WIDTH*60, _img.center.y +20, self.contentView.frame.size.width - 80, 20 * HEIGHT);
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
